package inheritance;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class StaticFinal {

	public static void main(String[] args) {
		System.out.println(A.FOO);	// FOO
		System.out.println(B.FOO);	// BAR
		A a1 = new A();
		A a2 = new B();
		B b1 = new B();
		
		System.out.println(a1.FOO);	// FOO
		System.out.println(a2.FOO);	// FOO
		System.out.println(b1.FOO); // BAR
		System.out.println(((A)b1).FOO); // FOO
		
	}
	
	static class A {
		public static final String FOO = "FOO";
		
		void method() {
			elemenet(new ArrayList<String>());
			elemenet(new ArrayList());
			elemenet(new ArrayList<Object>());
			elemenet(new List<String>() {

				@Override
				public int size() {
					// TODO Auto-generated method stub
					return 0;
				}

				@Override
				public boolean isEmpty() {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean contains(Object o) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public Iterator<String> iterator() {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public Object[] toArray() {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public <T> T[] toArray(T[] a) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public boolean add(String e) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean remove(Object o) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean containsAll(Collection<?> c) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean addAll(Collection<? extends String> c) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean addAll(int index, Collection<? extends String> c) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean removeAll(Collection<?> c) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public boolean retainAll(Collection<?> c) {
					// TODO Auto-generated method stub
					return false;
				}

				@Override
				public void clear() {
					// TODO Auto-generated method stub
					
				}

				@Override
				public String get(int index) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public String set(int index, String element) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public void add(int index, String element) {
					// TODO Auto-generated method stub
					
				}

				@Override
				public String remove(int index) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public int indexOf(Object o) {
					// TODO Auto-generated method stub
					return 0;
				}

				@Override
				public int lastIndexOf(Object o) {
					// TODO Auto-generated method stub
					return 0;
				}

				@Override
				public ListIterator<String> listIterator() {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public ListIterator<String> listIterator(int index) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public List<String> subList(int fromIndex, int toIndex) {
					// TODO Auto-generated method stub
					return null;
				}

			});
		}
		
		public void elemenet(List<?> a) {

		}
	}
	
	static class B extends A {
		public static final String FOO = "BAR";
		
//		private void method() {// cannot reduce the visibility of the inherited method
//			
//		}
		
		void xk() {
//			s(1);
			s(1);
		}
		
		void s(long l) { }
		
		void s(float f) { }
		
		void s(Integer i) {}
		
		void s(String s, int... i) {
			if (i.length > 0) {
				System.out.println(i[0]);
			}
		}
	}
	
}
